package com.lyshop.guiyingshanding.activitys;

import static com.lyshop.guiyingshanding.constants.Constant.H5_CANCEL_ACCOUNT;

import android.os.Build;
import android.view.View;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.widget.Button;

import com.lyshop.guiyingshanding.R;
import com.lyshop.guiyingshanding.base.BaseActivity;
import com.lyshop.guiyingshanding.utils.ToastUtil;

public class CancelAccountActivity extends BaseActivity implements View.OnClickListener {

    private WebView wv_provision;
    private Button cancelBtn;
    @Override
    protected int setContentView() {
        return R.layout.activity_cancel_account;
    }

    @Override
    protected void findViews() {
        wv_provision = (WebView) $(R.id.wv_provision);
        cancelBtn = (Button) $(R.id.btn_submit);
        WebSettings webSettings = wv_provision.getSettings();
        webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);
        webSettings.setJavaScriptEnabled(true);
        webSettings.setDomStorageEnabled(true);
        webSettings.setLoadWithOverviewMode(true);
        webSettings.setUseWideViewPort(true);
        webSettings.setLoadWithOverviewMode(true);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            webSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
        }
        wv_provision.loadUrl(H5_CANCEL_ACCOUNT);

    }

    @Override
    protected void setListeners() {
        cancelBtn.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        if(view.getId() == R.id.btn_submit){
            ToastUtil.showToast(mContext,"请联系客服协助申请注销账号");
            return;
        }
    }
}
